<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>添加编委</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">

<link href="css/space.css" rel="stylesheet" type="text/css">

<script type="text/javascript" src="js/jquery-1.9.1.js"></script>
<script type="text/javascript">
$(function() {
	$.ajax({
		type : "post",//发送方式       
		url : "space/getAllPerByChiefId.action",// 路径   
		data : "",
		success : function(data) {
			var obj = eval("(" + data + ")");
			var html = "";
			for(var i = 0; i < obj.length; i++) {
				html += "<option value='" + obj[i].periodicalId + "'>" + obj[i].name + "</option>";
			}
			$("#ajaxJsonSelectId>option").remove();
			$("#ajaxJsonSelectId").append(html);
		}
	});
});
</script>
</head>
<body>
	<div class="all">
		<div class="bodyge-left" style="font-size:13px;">
			<div class="bodyge-left-a1"><span class="font-b">添加编委</span></div>
			<form action="space/getUserByUserName.action" method="post">
				&nbsp;&nbsp;按会员用户名搜索：
				<input type="text" name="user.userName" />&nbsp;&nbsp;
				<input type="submit" class="inputStyle" value="搜索" />
				<!-- 隐藏域为了判断是 哪个页面请求的信息-->
				<input type="hidden" name="value" value="addEditorCommit" />
			</form>
			<form action="space/addEditorCommit.action" method="post">
				<table class="ma-tab" cellspacing=0px cellpadding=0px>
					<tr class="ma-tab-tr_a">
						<td width="90px">用户名</td>
						<td width="90px">姓名</td>
						<td width="150px">公司</td>
						<td width="80px">电话</td>
						<td width="120px">选择期刊</td>
						<td width="100px">操作</td>
					</tr>
					<tr height="5px"></tr>
					<c:if test="${user != null }">
					<tr>
						<td>${user.userName }</td>
						<td>${userExt.realName }</td>
						<td>${userExt.company }</td>
						<td>${userExt.tel }</td>
						<td align="center">
							<input type="hidden" name="editorCommit.userId" value="${user.userId }" /> 
							<input type="hidden" name="editorCommit.result" value="1" /> 
							<select id="ajaxJsonSelectId" name="editorCommit.periodicalId" style="width: 120px;">
								<option value="0">请选择</option>
							</select>
						</td>
						<td align="center">
						<c:if test="${user.roleId == 2}">
							<input type="submit" value="设为编委" />
						</c:if>
						<c:if test="${user.roleId != 2}">
							<input type="submit" disabled="disabled" value="已有其他职务" />
						</c:if>
						</td>
					</tr>
					</c:if>
				</table>
			</form>
		</div>
	</div>
</body>
</html>
